#ifndef _CHILD_H_
#define _CHILD_H_

#include "cobject.h"
#include "parent.h"

// 子类
typedef struct {
    cclass cls;
    parent_s pobj; // 继承自父类
    int c;
} child_s;

child_s *child_new(void);
void child_del(child_s **pself);
int child_ctor(child_s *self);
void child_dtor(child_s *self);

// 判断是否为parent类对象
#define child_type(obj) cobject_type((obj), CCLASS_NAME(child_s))

int child_print(cobject obj);
int child_get_val(cobject obj);
int child_set_val(cobject obj, int val);
#endif
